<?php


class EggUtil
{
    public function isOk($bool)
    {
        $result = array();
        if ($bool) {
            $str = "成功";
            /*$result["state"] = true;
            $result["code"] = 2000;*/
        } else {
            $str = "失败";
            /*$result["state"] = false;
            $result["code"] = 1000;*/
        }
        return $str;
    }

    public function foreachArray($array = [], $count = 1)
    {
        if (!is_array($array)) {
            return $count;
        }
        foreach ($array as $value) {
            $count++;
            if (!is_array($value)) {
                return $count;
            }
            return $this->foreachArray($value, $count);
        }
        return "error";
    }
}